﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Overview
{
    public partial class Form1 : Form
    {
        private DataHelper dh;
        private EventSite eventSite;
        private CampSite camping;
        public Form1()
        {
            InitializeComponent();
            dh = new DataHelper();
            eventSite = new EventSite("Death Fest", 3000);
            camping = new CampSite("DeathFest Campsite", 450, 60); 


        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            lbExitedEvent.Text = "Exited Event: " + eventSite.numOfExit().ToString();
            lbOnTerrain.Text = "Visitors on Terrain:" + eventSite.numEntered().ToString();
            lbVisitor.Text = "Total Visitors: " + eventSite.numOfVisitors().ToString();
            lbYetEnter.Text = "Not Entered Event Yet: " + eventSite.yetToEnter().ToString();
            label6.Text = "Exited the Campsite: " + camping.numOfExitCamping().ToString();
            lbOnCamp.Text = "On the Campsite: " + camping.onTheTerrain().ToString();
            lbSpotsFree.Text = "Camp Spots Available: " + camping.CampingSpotAvailable().ToString();
            lbMoneySpent.Text = "Total Money Spent: " + eventSite.totalSpent().ToString();
            lbMoneyAccount.Text = "Total Money on Accounts: " + eventSite.totalAcounts().ToString();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void Enter_Click(object sender, EventArgs e)
        {
            listBox3.Items.Clear();
            Visitor v;
            List<Item> temp;
            int id;

            id = dh.getId(tbName.Text);
            
            v = dh.getVisitor(id);
            temp = dh.GetRentedItem(Convert.ToInt32(textBox1.Text));

            listBox3.Items.Add(v.getVisId());
            listBox3.Items.Add(v.getName());
            listBox3.Items.Add(v.getBalance());
            foreach (Item item in temp)
            {
                listBox3.Items.Add(item.getName());
            }
            listBox3.Items.Add(v.getStatus());
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

      
    }
}
